import koa from 'koa';

export default (handle: (c: koa.Context) => Promise<unknown>) => {
  return async (ctx: koa.Context) => {
    ctx.status = 200;
    ctx.set('Content-Type', 'application/json');
    ctx.body = await handle(ctx);
  };
};
